package autotest_util

import (
	"net/http/httptest"
)

// 获取响应体数据并转成字符串
func GetBodyAsString(recorder *httptest.ResponseRecorder) string {
	body := recorder.Body
	bodyStr := body.String()

	return bodyStr
}

// 获取响应体数据并转成映射
func GetBodyAsMap(recorder *httptest.ResponseRecorder) map[string]any {
	body := recorder.Body
	bodyStr := body.String()
	result := ConvertJsonStringToMap(bodyStr)

	return result
}
